#pragma once
// MESSAGE ATTITUDE_BODY_DEBUG PACKING

#define MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG 21

MAVPACKED(
typedef struct __mavlink_attitude_body_debug_t {
 float roll_pre; /*<  roll prediction.*/
 float pitch_pre; /*<  pitch prediction.*/
 float yaw_pre; /*<  yaw prediction.*/
 float roll_obs; /*<  roll observe.*/
 float pitch_obs; /*<  pitch observe.*/
 float yaw_obs_mag; /*<  yaw magnet observe.*/
 float yaw_obs_rtk; /*<  yaw rtk observe.*/
 float roll_obs_sub_pred; /*<  roll observe deviation.*/
 float pitch_obs_sub_pred; /*<  roll observe deviation.*/
 float yaw_obs_sub_pred; /*<  roll observe deviation.*/
 float ba_x_pre; /*<  x predicte acceleration .*/
 float ba_y_pre; /*<  y predicte acceleration .*/
 float ba_z_pre; /*<  z predicte acceleration .*/
 float ba_x_obs; /*<  x observe acceleration .*/
 float ba_y_obs; /*<  y observe acceleration .*/
 float ba_z_obs; /*<  z observe acceleration .*/
 float bm_x_pre; /*<  x predicte magnet .*/
 float bm_y_pre; /*<  y predicte magnet .*/
 float bm_z_pre; /*<  z predicte magnet .*/
 float bm_x_obs; /*<  x observe magnet .*/
 float bm_y_obs; /*<  y observe magnet .*/
 float bm_z_obs; /*<  z observe magnet .*/
 float bw_norm; /*<  angle speed norm .*/
 float ba_norm; /*<  acceleration norm .*/
 float bm_norm; /*<  magnet norm .*/
 uint32_t time_used; /*<  used time.*/
 uint32_t static_state; /*<  static state.*/
 uint32_t disturb_state; /*<  disturb state.*/
}) mavlink_attitude_body_debug_t;

#define MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN 112
#define MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_MIN_LEN 112
#define MAVLINK_MSG_ID_21_LEN 112
#define MAVLINK_MSG_ID_21_MIN_LEN 112

#define MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_CRC 196
#define MAVLINK_MSG_ID_21_CRC 196



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_ATTITUDE_BODY_DEBUG { \
    21, \
    "ATTITUDE_BODY_DEBUG", \
    28, \
    {  { "roll_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_attitude_body_debug_t, roll_pre) }, \
         { "pitch_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_body_debug_t, pitch_pre) }, \
         { "yaw_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_body_debug_t, yaw_pre) }, \
         { "roll_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_body_debug_t, roll_obs) }, \
         { "pitch_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_body_debug_t, pitch_obs) }, \
         { "yaw_obs_mag", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_body_debug_t, yaw_obs_mag) }, \
         { "yaw_obs_rtk", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_body_debug_t, yaw_obs_rtk) }, \
         { "roll_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_body_debug_t, roll_obs_sub_pred) }, \
         { "pitch_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_body_debug_t, pitch_obs_sub_pred) }, \
         { "yaw_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_attitude_body_debug_t, yaw_obs_sub_pred) }, \
         { "ba_x_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_attitude_body_debug_t, ba_x_pre) }, \
         { "ba_y_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_attitude_body_debug_t, ba_y_pre) }, \
         { "ba_z_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_attitude_body_debug_t, ba_z_pre) }, \
         { "ba_x_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_attitude_body_debug_t, ba_x_obs) }, \
         { "ba_y_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_attitude_body_debug_t, ba_y_obs) }, \
         { "ba_z_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_attitude_body_debug_t, ba_z_obs) }, \
         { "bm_x_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_attitude_body_debug_t, bm_x_pre) }, \
         { "bm_y_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_attitude_body_debug_t, bm_y_pre) }, \
         { "bm_z_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_attitude_body_debug_t, bm_z_pre) }, \
         { "bm_x_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_attitude_body_debug_t, bm_x_obs) }, \
         { "bm_y_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_attitude_body_debug_t, bm_y_obs) }, \
         { "bm_z_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 84, offsetof(mavlink_attitude_body_debug_t, bm_z_obs) }, \
         { "bw_norm", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_attitude_body_debug_t, bw_norm) }, \
         { "ba_norm", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_attitude_body_debug_t, ba_norm) }, \
         { "bm_norm", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_attitude_body_debug_t, bm_norm) }, \
         { "time_used", NULL, MAVLINK_TYPE_UINT32_T, 0, 100, offsetof(mavlink_attitude_body_debug_t, time_used) }, \
         { "static_state", NULL, MAVLINK_TYPE_UINT32_T, 0, 104, offsetof(mavlink_attitude_body_debug_t, static_state) }, \
         { "disturb_state", NULL, MAVLINK_TYPE_UINT32_T, 0, 108, offsetof(mavlink_attitude_body_debug_t, disturb_state) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_ATTITUDE_BODY_DEBUG { \
    "ATTITUDE_BODY_DEBUG", \
    28, \
    {  { "roll_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_attitude_body_debug_t, roll_pre) }, \
         { "pitch_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_attitude_body_debug_t, pitch_pre) }, \
         { "yaw_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_body_debug_t, yaw_pre) }, \
         { "roll_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_body_debug_t, roll_obs) }, \
         { "pitch_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_body_debug_t, pitch_obs) }, \
         { "yaw_obs_mag", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_body_debug_t, yaw_obs_mag) }, \
         { "yaw_obs_rtk", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_body_debug_t, yaw_obs_rtk) }, \
         { "roll_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_body_debug_t, roll_obs_sub_pred) }, \
         { "pitch_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_body_debug_t, pitch_obs_sub_pred) }, \
         { "yaw_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_attitude_body_debug_t, yaw_obs_sub_pred) }, \
         { "ba_x_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_attitude_body_debug_t, ba_x_pre) }, \
         { "ba_y_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_attitude_body_debug_t, ba_y_pre) }, \
         { "ba_z_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_attitude_body_debug_t, ba_z_pre) }, \
         { "ba_x_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_attitude_body_debug_t, ba_x_obs) }, \
         { "ba_y_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_attitude_body_debug_t, ba_y_obs) }, \
         { "ba_z_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_attitude_body_debug_t, ba_z_obs) }, \
         { "bm_x_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_attitude_body_debug_t, bm_x_pre) }, \
         { "bm_y_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_attitude_body_debug_t, bm_y_pre) }, \
         { "bm_z_pre", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_attitude_body_debug_t, bm_z_pre) }, \
         { "bm_x_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_attitude_body_debug_t, bm_x_obs) }, \
         { "bm_y_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_attitude_body_debug_t, bm_y_obs) }, \
         { "bm_z_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 84, offsetof(mavlink_attitude_body_debug_t, bm_z_obs) }, \
         { "bw_norm", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_attitude_body_debug_t, bw_norm) }, \
         { "ba_norm", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_attitude_body_debug_t, ba_norm) }, \
         { "bm_norm", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_attitude_body_debug_t, bm_norm) }, \
         { "time_used", NULL, MAVLINK_TYPE_UINT32_T, 0, 100, offsetof(mavlink_attitude_body_debug_t, time_used) }, \
         { "static_state", NULL, MAVLINK_TYPE_UINT32_T, 0, 104, offsetof(mavlink_attitude_body_debug_t, static_state) }, \
         { "disturb_state", NULL, MAVLINK_TYPE_UINT32_T, 0, 108, offsetof(mavlink_attitude_body_debug_t, disturb_state) }, \
         } \
}
#endif

/**
 * @brief Pack a attitude_body_debug message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param roll_pre  roll prediction.
 * @param pitch_pre  pitch prediction.
 * @param yaw_pre  yaw prediction.
 * @param roll_obs  roll observe.
 * @param pitch_obs  pitch observe.
 * @param yaw_obs_mag  yaw magnet observe.
 * @param yaw_obs_rtk  yaw rtk observe.
 * @param roll_obs_sub_pred  roll observe deviation.
 * @param pitch_obs_sub_pred  roll observe deviation.
 * @param yaw_obs_sub_pred  roll observe deviation.
 * @param ba_x_pre  x predicte acceleration .
 * @param ba_y_pre  y predicte acceleration .
 * @param ba_z_pre  z predicte acceleration .
 * @param ba_x_obs  x observe acceleration .
 * @param ba_y_obs  y observe acceleration .
 * @param ba_z_obs  z observe acceleration .
 * @param bm_x_pre  x predicte magnet .
 * @param bm_y_pre  y predicte magnet .
 * @param bm_z_pre  z predicte magnet .
 * @param bm_x_obs  x observe magnet .
 * @param bm_y_obs  y observe magnet .
 * @param bm_z_obs  z observe magnet .
 * @param bw_norm  angle speed norm .
 * @param ba_norm  acceleration norm .
 * @param bm_norm  magnet norm .
 * @param time_used  used time.
 * @param static_state  static state.
 * @param disturb_state  disturb state.
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_attitude_body_debug_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               float roll_pre, float pitch_pre, float yaw_pre, float roll_obs, float pitch_obs, float yaw_obs_mag, float yaw_obs_rtk, float roll_obs_sub_pred, float pitch_obs_sub_pred, float yaw_obs_sub_pred, float ba_x_pre, float ba_y_pre, float ba_z_pre, float ba_x_obs, float ba_y_obs, float ba_z_obs, float bm_x_pre, float bm_y_pre, float bm_z_pre, float bm_x_obs, float bm_y_obs, float bm_z_obs, float bw_norm, float ba_norm, float bm_norm, uint32_t time_used, uint32_t static_state, uint32_t disturb_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN];
    _mav_put_float(buf, 0, roll_pre);
    _mav_put_float(buf, 4, pitch_pre);
    _mav_put_float(buf, 8, yaw_pre);
    _mav_put_float(buf, 12, roll_obs);
    _mav_put_float(buf, 16, pitch_obs);
    _mav_put_float(buf, 20, yaw_obs_mag);
    _mav_put_float(buf, 24, yaw_obs_rtk);
    _mav_put_float(buf, 28, roll_obs_sub_pred);
    _mav_put_float(buf, 32, pitch_obs_sub_pred);
    _mav_put_float(buf, 36, yaw_obs_sub_pred);
    _mav_put_float(buf, 40, ba_x_pre);
    _mav_put_float(buf, 44, ba_y_pre);
    _mav_put_float(buf, 48, ba_z_pre);
    _mav_put_float(buf, 52, ba_x_obs);
    _mav_put_float(buf, 56, ba_y_obs);
    _mav_put_float(buf, 60, ba_z_obs);
    _mav_put_float(buf, 64, bm_x_pre);
    _mav_put_float(buf, 68, bm_y_pre);
    _mav_put_float(buf, 72, bm_z_pre);
    _mav_put_float(buf, 76, bm_x_obs);
    _mav_put_float(buf, 80, bm_y_obs);
    _mav_put_float(buf, 84, bm_z_obs);
    _mav_put_float(buf, 88, bw_norm);
    _mav_put_float(buf, 92, ba_norm);
    _mav_put_float(buf, 96, bm_norm);
    _mav_put_uint32_t(buf, 100, time_used);
    _mav_put_uint32_t(buf, 104, static_state);
    _mav_put_uint32_t(buf, 108, disturb_state);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN);
#else
    mavlink_attitude_body_debug_t packet;
    packet.roll_pre = roll_pre;
    packet.pitch_pre = pitch_pre;
    packet.yaw_pre = yaw_pre;
    packet.roll_obs = roll_obs;
    packet.pitch_obs = pitch_obs;
    packet.yaw_obs_mag = yaw_obs_mag;
    packet.yaw_obs_rtk = yaw_obs_rtk;
    packet.roll_obs_sub_pred = roll_obs_sub_pred;
    packet.pitch_obs_sub_pred = pitch_obs_sub_pred;
    packet.yaw_obs_sub_pred = yaw_obs_sub_pred;
    packet.ba_x_pre = ba_x_pre;
    packet.ba_y_pre = ba_y_pre;
    packet.ba_z_pre = ba_z_pre;
    packet.ba_x_obs = ba_x_obs;
    packet.ba_y_obs = ba_y_obs;
    packet.ba_z_obs = ba_z_obs;
    packet.bm_x_pre = bm_x_pre;
    packet.bm_y_pre = bm_y_pre;
    packet.bm_z_pre = bm_z_pre;
    packet.bm_x_obs = bm_x_obs;
    packet.bm_y_obs = bm_y_obs;
    packet.bm_z_obs = bm_z_obs;
    packet.bw_norm = bw_norm;
    packet.ba_norm = ba_norm;
    packet.bm_norm = bm_norm;
    packet.time_used = time_used;
    packet.static_state = static_state;
    packet.disturb_state = disturb_state;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_CRC);
}

/**
 * @brief Pack a attitude_body_debug message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param roll_pre  roll prediction.
 * @param pitch_pre  pitch prediction.
 * @param yaw_pre  yaw prediction.
 * @param roll_obs  roll observe.
 * @param pitch_obs  pitch observe.
 * @param yaw_obs_mag  yaw magnet observe.
 * @param yaw_obs_rtk  yaw rtk observe.
 * @param roll_obs_sub_pred  roll observe deviation.
 * @param pitch_obs_sub_pred  roll observe deviation.
 * @param yaw_obs_sub_pred  roll observe deviation.
 * @param ba_x_pre  x predicte acceleration .
 * @param ba_y_pre  y predicte acceleration .
 * @param ba_z_pre  z predicte acceleration .
 * @param ba_x_obs  x observe acceleration .
 * @param ba_y_obs  y observe acceleration .
 * @param ba_z_obs  z observe acceleration .
 * @param bm_x_pre  x predicte magnet .
 * @param bm_y_pre  y predicte magnet .
 * @param bm_z_pre  z predicte magnet .
 * @param bm_x_obs  x observe magnet .
 * @param bm_y_obs  y observe magnet .
 * @param bm_z_obs  z observe magnet .
 * @param bw_norm  angle speed norm .
 * @param ba_norm  acceleration norm .
 * @param bm_norm  magnet norm .
 * @param time_used  used time.
 * @param static_state  static state.
 * @param disturb_state  disturb state.
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_attitude_body_debug_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   float roll_pre,float pitch_pre,float yaw_pre,float roll_obs,float pitch_obs,float yaw_obs_mag,float yaw_obs_rtk,float roll_obs_sub_pred,float pitch_obs_sub_pred,float yaw_obs_sub_pred,float ba_x_pre,float ba_y_pre,float ba_z_pre,float ba_x_obs,float ba_y_obs,float ba_z_obs,float bm_x_pre,float bm_y_pre,float bm_z_pre,float bm_x_obs,float bm_y_obs,float bm_z_obs,float bw_norm,float ba_norm,float bm_norm,uint32_t time_used,uint32_t static_state,uint32_t disturb_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN];
    _mav_put_float(buf, 0, roll_pre);
    _mav_put_float(buf, 4, pitch_pre);
    _mav_put_float(buf, 8, yaw_pre);
    _mav_put_float(buf, 12, roll_obs);
    _mav_put_float(buf, 16, pitch_obs);
    _mav_put_float(buf, 20, yaw_obs_mag);
    _mav_put_float(buf, 24, yaw_obs_rtk);
    _mav_put_float(buf, 28, roll_obs_sub_pred);
    _mav_put_float(buf, 32, pitch_obs_sub_pred);
    _mav_put_float(buf, 36, yaw_obs_sub_pred);
    _mav_put_float(buf, 40, ba_x_pre);
    _mav_put_float(buf, 44, ba_y_pre);
    _mav_put_float(buf, 48, ba_z_pre);
    _mav_put_float(buf, 52, ba_x_obs);
    _mav_put_float(buf, 56, ba_y_obs);
    _mav_put_float(buf, 60, ba_z_obs);
    _mav_put_float(buf, 64, bm_x_pre);
    _mav_put_float(buf, 68, bm_y_pre);
    _mav_put_float(buf, 72, bm_z_pre);
    _mav_put_float(buf, 76, bm_x_obs);
    _mav_put_float(buf, 80, bm_y_obs);
    _mav_put_float(buf, 84, bm_z_obs);
    _mav_put_float(buf, 88, bw_norm);
    _mav_put_float(buf, 92, ba_norm);
    _mav_put_float(buf, 96, bm_norm);
    _mav_put_uint32_t(buf, 100, time_used);
    _mav_put_uint32_t(buf, 104, static_state);
    _mav_put_uint32_t(buf, 108, disturb_state);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN);
#else
    mavlink_attitude_body_debug_t packet;
    packet.roll_pre = roll_pre;
    packet.pitch_pre = pitch_pre;
    packet.yaw_pre = yaw_pre;
    packet.roll_obs = roll_obs;
    packet.pitch_obs = pitch_obs;
    packet.yaw_obs_mag = yaw_obs_mag;
    packet.yaw_obs_rtk = yaw_obs_rtk;
    packet.roll_obs_sub_pred = roll_obs_sub_pred;
    packet.pitch_obs_sub_pred = pitch_obs_sub_pred;
    packet.yaw_obs_sub_pred = yaw_obs_sub_pred;
    packet.ba_x_pre = ba_x_pre;
    packet.ba_y_pre = ba_y_pre;
    packet.ba_z_pre = ba_z_pre;
    packet.ba_x_obs = ba_x_obs;
    packet.ba_y_obs = ba_y_obs;
    packet.ba_z_obs = ba_z_obs;
    packet.bm_x_pre = bm_x_pre;
    packet.bm_y_pre = bm_y_pre;
    packet.bm_z_pre = bm_z_pre;
    packet.bm_x_obs = bm_x_obs;
    packet.bm_y_obs = bm_y_obs;
    packet.bm_z_obs = bm_z_obs;
    packet.bw_norm = bw_norm;
    packet.ba_norm = ba_norm;
    packet.bm_norm = bm_norm;
    packet.time_used = time_used;
    packet.static_state = static_state;
    packet.disturb_state = disturb_state;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_CRC);
}

/**
 * @brief Encode a attitude_body_debug struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param attitude_body_debug C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_attitude_body_debug_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_body_debug_t* attitude_body_debug)
{
    return mavlink_msg_attitude_body_debug_pack(system_id, component_id, msg, attitude_body_debug->roll_pre, attitude_body_debug->pitch_pre, attitude_body_debug->yaw_pre, attitude_body_debug->roll_obs, attitude_body_debug->pitch_obs, attitude_body_debug->yaw_obs_mag, attitude_body_debug->yaw_obs_rtk, attitude_body_debug->roll_obs_sub_pred, attitude_body_debug->pitch_obs_sub_pred, attitude_body_debug->yaw_obs_sub_pred, attitude_body_debug->ba_x_pre, attitude_body_debug->ba_y_pre, attitude_body_debug->ba_z_pre, attitude_body_debug->ba_x_obs, attitude_body_debug->ba_y_obs, attitude_body_debug->ba_z_obs, attitude_body_debug->bm_x_pre, attitude_body_debug->bm_y_pre, attitude_body_debug->bm_z_pre, attitude_body_debug->bm_x_obs, attitude_body_debug->bm_y_obs, attitude_body_debug->bm_z_obs, attitude_body_debug->bw_norm, attitude_body_debug->ba_norm, attitude_body_debug->bm_norm, attitude_body_debug->time_used, attitude_body_debug->static_state, attitude_body_debug->disturb_state);
}

/**
 * @brief Encode a attitude_body_debug struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param attitude_body_debug C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_attitude_body_debug_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_body_debug_t* attitude_body_debug)
{
    return mavlink_msg_attitude_body_debug_pack_chan(system_id, component_id, chan, msg, attitude_body_debug->roll_pre, attitude_body_debug->pitch_pre, attitude_body_debug->yaw_pre, attitude_body_debug->roll_obs, attitude_body_debug->pitch_obs, attitude_body_debug->yaw_obs_mag, attitude_body_debug->yaw_obs_rtk, attitude_body_debug->roll_obs_sub_pred, attitude_body_debug->pitch_obs_sub_pred, attitude_body_debug->yaw_obs_sub_pred, attitude_body_debug->ba_x_pre, attitude_body_debug->ba_y_pre, attitude_body_debug->ba_z_pre, attitude_body_debug->ba_x_obs, attitude_body_debug->ba_y_obs, attitude_body_debug->ba_z_obs, attitude_body_debug->bm_x_pre, attitude_body_debug->bm_y_pre, attitude_body_debug->bm_z_pre, attitude_body_debug->bm_x_obs, attitude_body_debug->bm_y_obs, attitude_body_debug->bm_z_obs, attitude_body_debug->bw_norm, attitude_body_debug->ba_norm, attitude_body_debug->bm_norm, attitude_body_debug->time_used, attitude_body_debug->static_state, attitude_body_debug->disturb_state);
}

/**
 * @brief Send a attitude_body_debug message
 * @param chan MAVLink channel to send the message
 *
 * @param roll_pre  roll prediction.
 * @param pitch_pre  pitch prediction.
 * @param yaw_pre  yaw prediction.
 * @param roll_obs  roll observe.
 * @param pitch_obs  pitch observe.
 * @param yaw_obs_mag  yaw magnet observe.
 * @param yaw_obs_rtk  yaw rtk observe.
 * @param roll_obs_sub_pred  roll observe deviation.
 * @param pitch_obs_sub_pred  roll observe deviation.
 * @param yaw_obs_sub_pred  roll observe deviation.
 * @param ba_x_pre  x predicte acceleration .
 * @param ba_y_pre  y predicte acceleration .
 * @param ba_z_pre  z predicte acceleration .
 * @param ba_x_obs  x observe acceleration .
 * @param ba_y_obs  y observe acceleration .
 * @param ba_z_obs  z observe acceleration .
 * @param bm_x_pre  x predicte magnet .
 * @param bm_y_pre  y predicte magnet .
 * @param bm_z_pre  z predicte magnet .
 * @param bm_x_obs  x observe magnet .
 * @param bm_y_obs  y observe magnet .
 * @param bm_z_obs  z observe magnet .
 * @param bw_norm  angle speed norm .
 * @param ba_norm  acceleration norm .
 * @param bm_norm  magnet norm .
 * @param time_used  used time.
 * @param static_state  static state.
 * @param disturb_state  disturb state.
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_attitude_body_debug_send(mavlink_channel_t chan, float roll_pre, float pitch_pre, float yaw_pre, float roll_obs, float pitch_obs, float yaw_obs_mag, float yaw_obs_rtk, float roll_obs_sub_pred, float pitch_obs_sub_pred, float yaw_obs_sub_pred, float ba_x_pre, float ba_y_pre, float ba_z_pre, float ba_x_obs, float ba_y_obs, float ba_z_obs, float bm_x_pre, float bm_y_pre, float bm_z_pre, float bm_x_obs, float bm_y_obs, float bm_z_obs, float bw_norm, float ba_norm, float bm_norm, uint32_t time_used, uint32_t static_state, uint32_t disturb_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN];
    _mav_put_float(buf, 0, roll_pre);
    _mav_put_float(buf, 4, pitch_pre);
    _mav_put_float(buf, 8, yaw_pre);
    _mav_put_float(buf, 12, roll_obs);
    _mav_put_float(buf, 16, pitch_obs);
    _mav_put_float(buf, 20, yaw_obs_mag);
    _mav_put_float(buf, 24, yaw_obs_rtk);
    _mav_put_float(buf, 28, roll_obs_sub_pred);
    _mav_put_float(buf, 32, pitch_obs_sub_pred);
    _mav_put_float(buf, 36, yaw_obs_sub_pred);
    _mav_put_float(buf, 40, ba_x_pre);
    _mav_put_float(buf, 44, ba_y_pre);
    _mav_put_float(buf, 48, ba_z_pre);
    _mav_put_float(buf, 52, ba_x_obs);
    _mav_put_float(buf, 56, ba_y_obs);
    _mav_put_float(buf, 60, ba_z_obs);
    _mav_put_float(buf, 64, bm_x_pre);
    _mav_put_float(buf, 68, bm_y_pre);
    _mav_put_float(buf, 72, bm_z_pre);
    _mav_put_float(buf, 76, bm_x_obs);
    _mav_put_float(buf, 80, bm_y_obs);
    _mav_put_float(buf, 84, bm_z_obs);
    _mav_put_float(buf, 88, bw_norm);
    _mav_put_float(buf, 92, ba_norm);
    _mav_put_float(buf, 96, bm_norm);
    _mav_put_uint32_t(buf, 100, time_used);
    _mav_put_uint32_t(buf, 104, static_state);
    _mav_put_uint32_t(buf, 108, disturb_state);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG, buf, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_CRC);
#else
    mavlink_attitude_body_debug_t packet;
    packet.roll_pre = roll_pre;
    packet.pitch_pre = pitch_pre;
    packet.yaw_pre = yaw_pre;
    packet.roll_obs = roll_obs;
    packet.pitch_obs = pitch_obs;
    packet.yaw_obs_mag = yaw_obs_mag;
    packet.yaw_obs_rtk = yaw_obs_rtk;
    packet.roll_obs_sub_pred = roll_obs_sub_pred;
    packet.pitch_obs_sub_pred = pitch_obs_sub_pred;
    packet.yaw_obs_sub_pred = yaw_obs_sub_pred;
    packet.ba_x_pre = ba_x_pre;
    packet.ba_y_pre = ba_y_pre;
    packet.ba_z_pre = ba_z_pre;
    packet.ba_x_obs = ba_x_obs;
    packet.ba_y_obs = ba_y_obs;
    packet.ba_z_obs = ba_z_obs;
    packet.bm_x_pre = bm_x_pre;
    packet.bm_y_pre = bm_y_pre;
    packet.bm_z_pre = bm_z_pre;
    packet.bm_x_obs = bm_x_obs;
    packet.bm_y_obs = bm_y_obs;
    packet.bm_z_obs = bm_z_obs;
    packet.bw_norm = bw_norm;
    packet.ba_norm = ba_norm;
    packet.bm_norm = bm_norm;
    packet.time_used = time_used;
    packet.static_state = static_state;
    packet.disturb_state = disturb_state;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_CRC);
#endif
}

/**
 * @brief Send a attitude_body_debug message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_attitude_body_debug_send_struct(mavlink_channel_t chan, const mavlink_attitude_body_debug_t* attitude_body_debug)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_attitude_body_debug_send(chan, attitude_body_debug->roll_pre, attitude_body_debug->pitch_pre, attitude_body_debug->yaw_pre, attitude_body_debug->roll_obs, attitude_body_debug->pitch_obs, attitude_body_debug->yaw_obs_mag, attitude_body_debug->yaw_obs_rtk, attitude_body_debug->roll_obs_sub_pred, attitude_body_debug->pitch_obs_sub_pred, attitude_body_debug->yaw_obs_sub_pred, attitude_body_debug->ba_x_pre, attitude_body_debug->ba_y_pre, attitude_body_debug->ba_z_pre, attitude_body_debug->ba_x_obs, attitude_body_debug->ba_y_obs, attitude_body_debug->ba_z_obs, attitude_body_debug->bm_x_pre, attitude_body_debug->bm_y_pre, attitude_body_debug->bm_z_pre, attitude_body_debug->bm_x_obs, attitude_body_debug->bm_y_obs, attitude_body_debug->bm_z_obs, attitude_body_debug->bw_norm, attitude_body_debug->ba_norm, attitude_body_debug->bm_norm, attitude_body_debug->time_used, attitude_body_debug->static_state, attitude_body_debug->disturb_state);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG, (const char *)attitude_body_debug, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_CRC);
#endif
}

#if MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_attitude_body_debug_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  float roll_pre, float pitch_pre, float yaw_pre, float roll_obs, float pitch_obs, float yaw_obs_mag, float yaw_obs_rtk, float roll_obs_sub_pred, float pitch_obs_sub_pred, float yaw_obs_sub_pred, float ba_x_pre, float ba_y_pre, float ba_z_pre, float ba_x_obs, float ba_y_obs, float ba_z_obs, float bm_x_pre, float bm_y_pre, float bm_z_pre, float bm_x_obs, float bm_y_obs, float bm_z_obs, float bw_norm, float ba_norm, float bm_norm, uint32_t time_used, uint32_t static_state, uint32_t disturb_state)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_float(buf, 0, roll_pre);
    _mav_put_float(buf, 4, pitch_pre);
    _mav_put_float(buf, 8, yaw_pre);
    _mav_put_float(buf, 12, roll_obs);
    _mav_put_float(buf, 16, pitch_obs);
    _mav_put_float(buf, 20, yaw_obs_mag);
    _mav_put_float(buf, 24, yaw_obs_rtk);
    _mav_put_float(buf, 28, roll_obs_sub_pred);
    _mav_put_float(buf, 32, pitch_obs_sub_pred);
    _mav_put_float(buf, 36, yaw_obs_sub_pred);
    _mav_put_float(buf, 40, ba_x_pre);
    _mav_put_float(buf, 44, ba_y_pre);
    _mav_put_float(buf, 48, ba_z_pre);
    _mav_put_float(buf, 52, ba_x_obs);
    _mav_put_float(buf, 56, ba_y_obs);
    _mav_put_float(buf, 60, ba_z_obs);
    _mav_put_float(buf, 64, bm_x_pre);
    _mav_put_float(buf, 68, bm_y_pre);
    _mav_put_float(buf, 72, bm_z_pre);
    _mav_put_float(buf, 76, bm_x_obs);
    _mav_put_float(buf, 80, bm_y_obs);
    _mav_put_float(buf, 84, bm_z_obs);
    _mav_put_float(buf, 88, bw_norm);
    _mav_put_float(buf, 92, ba_norm);
    _mav_put_float(buf, 96, bm_norm);
    _mav_put_uint32_t(buf, 100, time_used);
    _mav_put_uint32_t(buf, 104, static_state);
    _mav_put_uint32_t(buf, 108, disturb_state);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG, buf, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_CRC);
#else
    mavlink_attitude_body_debug_t *packet = (mavlink_attitude_body_debug_t *)msgbuf;
    packet->roll_pre = roll_pre;
    packet->pitch_pre = pitch_pre;
    packet->yaw_pre = yaw_pre;
    packet->roll_obs = roll_obs;
    packet->pitch_obs = pitch_obs;
    packet->yaw_obs_mag = yaw_obs_mag;
    packet->yaw_obs_rtk = yaw_obs_rtk;
    packet->roll_obs_sub_pred = roll_obs_sub_pred;
    packet->pitch_obs_sub_pred = pitch_obs_sub_pred;
    packet->yaw_obs_sub_pred = yaw_obs_sub_pred;
    packet->ba_x_pre = ba_x_pre;
    packet->ba_y_pre = ba_y_pre;
    packet->ba_z_pre = ba_z_pre;
    packet->ba_x_obs = ba_x_obs;
    packet->ba_y_obs = ba_y_obs;
    packet->ba_z_obs = ba_z_obs;
    packet->bm_x_pre = bm_x_pre;
    packet->bm_y_pre = bm_y_pre;
    packet->bm_z_pre = bm_z_pre;
    packet->bm_x_obs = bm_x_obs;
    packet->bm_y_obs = bm_y_obs;
    packet->bm_z_obs = bm_z_obs;
    packet->bw_norm = bw_norm;
    packet->ba_norm = ba_norm;
    packet->bm_norm = bm_norm;
    packet->time_used = time_used;
    packet->static_state = static_state;
    packet->disturb_state = disturb_state;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_CRC);
#endif
}
#endif

#endif

// MESSAGE ATTITUDE_BODY_DEBUG UNPACKING


/**
 * @brief Get field roll_pre from attitude_body_debug message
 *
 * @return  roll prediction.
 */
static inline float mavlink_msg_attitude_body_debug_get_roll_pre(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  0);
}

/**
 * @brief Get field pitch_pre from attitude_body_debug message
 *
 * @return  pitch prediction.
 */
static inline float mavlink_msg_attitude_body_debug_get_pitch_pre(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  4);
}

/**
 * @brief Get field yaw_pre from attitude_body_debug message
 *
 * @return  yaw prediction.
 */
static inline float mavlink_msg_attitude_body_debug_get_yaw_pre(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  8);
}

/**
 * @brief Get field roll_obs from attitude_body_debug message
 *
 * @return  roll observe.
 */
static inline float mavlink_msg_attitude_body_debug_get_roll_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  12);
}

/**
 * @brief Get field pitch_obs from attitude_body_debug message
 *
 * @return  pitch observe.
 */
static inline float mavlink_msg_attitude_body_debug_get_pitch_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  16);
}

/**
 * @brief Get field yaw_obs_mag from attitude_body_debug message
 *
 * @return  yaw magnet observe.
 */
static inline float mavlink_msg_attitude_body_debug_get_yaw_obs_mag(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  20);
}

/**
 * @brief Get field yaw_obs_rtk from attitude_body_debug message
 *
 * @return  yaw rtk observe.
 */
static inline float mavlink_msg_attitude_body_debug_get_yaw_obs_rtk(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  24);
}

/**
 * @brief Get field roll_obs_sub_pred from attitude_body_debug message
 *
 * @return  roll observe deviation.
 */
static inline float mavlink_msg_attitude_body_debug_get_roll_obs_sub_pred(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  28);
}

/**
 * @brief Get field pitch_obs_sub_pred from attitude_body_debug message
 *
 * @return  roll observe deviation.
 */
static inline float mavlink_msg_attitude_body_debug_get_pitch_obs_sub_pred(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  32);
}

/**
 * @brief Get field yaw_obs_sub_pred from attitude_body_debug message
 *
 * @return  roll observe deviation.
 */
static inline float mavlink_msg_attitude_body_debug_get_yaw_obs_sub_pred(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  36);
}

/**
 * @brief Get field ba_x_pre from attitude_body_debug message
 *
 * @return  x predicte acceleration .
 */
static inline float mavlink_msg_attitude_body_debug_get_ba_x_pre(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  40);
}

/**
 * @brief Get field ba_y_pre from attitude_body_debug message
 *
 * @return  y predicte acceleration .
 */
static inline float mavlink_msg_attitude_body_debug_get_ba_y_pre(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  44);
}

/**
 * @brief Get field ba_z_pre from attitude_body_debug message
 *
 * @return  z predicte acceleration .
 */
static inline float mavlink_msg_attitude_body_debug_get_ba_z_pre(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  48);
}

/**
 * @brief Get field ba_x_obs from attitude_body_debug message
 *
 * @return  x observe acceleration .
 */
static inline float mavlink_msg_attitude_body_debug_get_ba_x_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  52);
}

/**
 * @brief Get field ba_y_obs from attitude_body_debug message
 *
 * @return  y observe acceleration .
 */
static inline float mavlink_msg_attitude_body_debug_get_ba_y_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  56);
}

/**
 * @brief Get field ba_z_obs from attitude_body_debug message
 *
 * @return  z observe acceleration .
 */
static inline float mavlink_msg_attitude_body_debug_get_ba_z_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  60);
}

/**
 * @brief Get field bm_x_pre from attitude_body_debug message
 *
 * @return  x predicte magnet .
 */
static inline float mavlink_msg_attitude_body_debug_get_bm_x_pre(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  64);
}

/**
 * @brief Get field bm_y_pre from attitude_body_debug message
 *
 * @return  y predicte magnet .
 */
static inline float mavlink_msg_attitude_body_debug_get_bm_y_pre(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  68);
}

/**
 * @brief Get field bm_z_pre from attitude_body_debug message
 *
 * @return  z predicte magnet .
 */
static inline float mavlink_msg_attitude_body_debug_get_bm_z_pre(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  72);
}

/**
 * @brief Get field bm_x_obs from attitude_body_debug message
 *
 * @return  x observe magnet .
 */
static inline float mavlink_msg_attitude_body_debug_get_bm_x_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  76);
}

/**
 * @brief Get field bm_y_obs from attitude_body_debug message
 *
 * @return  y observe magnet .
 */
static inline float mavlink_msg_attitude_body_debug_get_bm_y_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  80);
}

/**
 * @brief Get field bm_z_obs from attitude_body_debug message
 *
 * @return  z observe magnet .
 */
static inline float mavlink_msg_attitude_body_debug_get_bm_z_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  84);
}

/**
 * @brief Get field bw_norm from attitude_body_debug message
 *
 * @return  angle speed norm .
 */
static inline float mavlink_msg_attitude_body_debug_get_bw_norm(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  88);
}

/**
 * @brief Get field ba_norm from attitude_body_debug message
 *
 * @return  acceleration norm .
 */
static inline float mavlink_msg_attitude_body_debug_get_ba_norm(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  92);
}

/**
 * @brief Get field bm_norm from attitude_body_debug message
 *
 * @return  magnet norm .
 */
static inline float mavlink_msg_attitude_body_debug_get_bm_norm(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  96);
}

/**
 * @brief Get field time_used from attitude_body_debug message
 *
 * @return  used time.
 */
static inline uint32_t mavlink_msg_attitude_body_debug_get_time_used(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  100);
}

/**
 * @brief Get field static_state from attitude_body_debug message
 *
 * @return  static state.
 */
static inline uint32_t mavlink_msg_attitude_body_debug_get_static_state(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  104);
}

/**
 * @brief Get field disturb_state from attitude_body_debug message
 *
 * @return  disturb state.
 */
static inline uint32_t mavlink_msg_attitude_body_debug_get_disturb_state(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  108);
}

/**
 * @brief Decode a attitude_body_debug message into a struct
 *
 * @param msg The message to decode
 * @param attitude_body_debug C-struct to decode the message contents into
 */
static inline void mavlink_msg_attitude_body_debug_decode(const mavlink_message_t* msg, mavlink_attitude_body_debug_t* attitude_body_debug)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    attitude_body_debug->roll_pre = mavlink_msg_attitude_body_debug_get_roll_pre(msg);
    attitude_body_debug->pitch_pre = mavlink_msg_attitude_body_debug_get_pitch_pre(msg);
    attitude_body_debug->yaw_pre = mavlink_msg_attitude_body_debug_get_yaw_pre(msg);
    attitude_body_debug->roll_obs = mavlink_msg_attitude_body_debug_get_roll_obs(msg);
    attitude_body_debug->pitch_obs = mavlink_msg_attitude_body_debug_get_pitch_obs(msg);
    attitude_body_debug->yaw_obs_mag = mavlink_msg_attitude_body_debug_get_yaw_obs_mag(msg);
    attitude_body_debug->yaw_obs_rtk = mavlink_msg_attitude_body_debug_get_yaw_obs_rtk(msg);
    attitude_body_debug->roll_obs_sub_pred = mavlink_msg_attitude_body_debug_get_roll_obs_sub_pred(msg);
    attitude_body_debug->pitch_obs_sub_pred = mavlink_msg_attitude_body_debug_get_pitch_obs_sub_pred(msg);
    attitude_body_debug->yaw_obs_sub_pred = mavlink_msg_attitude_body_debug_get_yaw_obs_sub_pred(msg);
    attitude_body_debug->ba_x_pre = mavlink_msg_attitude_body_debug_get_ba_x_pre(msg);
    attitude_body_debug->ba_y_pre = mavlink_msg_attitude_body_debug_get_ba_y_pre(msg);
    attitude_body_debug->ba_z_pre = mavlink_msg_attitude_body_debug_get_ba_z_pre(msg);
    attitude_body_debug->ba_x_obs = mavlink_msg_attitude_body_debug_get_ba_x_obs(msg);
    attitude_body_debug->ba_y_obs = mavlink_msg_attitude_body_debug_get_ba_y_obs(msg);
    attitude_body_debug->ba_z_obs = mavlink_msg_attitude_body_debug_get_ba_z_obs(msg);
    attitude_body_debug->bm_x_pre = mavlink_msg_attitude_body_debug_get_bm_x_pre(msg);
    attitude_body_debug->bm_y_pre = mavlink_msg_attitude_body_debug_get_bm_y_pre(msg);
    attitude_body_debug->bm_z_pre = mavlink_msg_attitude_body_debug_get_bm_z_pre(msg);
    attitude_body_debug->bm_x_obs = mavlink_msg_attitude_body_debug_get_bm_x_obs(msg);
    attitude_body_debug->bm_y_obs = mavlink_msg_attitude_body_debug_get_bm_y_obs(msg);
    attitude_body_debug->bm_z_obs = mavlink_msg_attitude_body_debug_get_bm_z_obs(msg);
    attitude_body_debug->bw_norm = mavlink_msg_attitude_body_debug_get_bw_norm(msg);
    attitude_body_debug->ba_norm = mavlink_msg_attitude_body_debug_get_ba_norm(msg);
    attitude_body_debug->bm_norm = mavlink_msg_attitude_body_debug_get_bm_norm(msg);
    attitude_body_debug->time_used = mavlink_msg_attitude_body_debug_get_time_used(msg);
    attitude_body_debug->static_state = mavlink_msg_attitude_body_debug_get_static_state(msg);
    attitude_body_debug->disturb_state = mavlink_msg_attitude_body_debug_get_disturb_state(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN;
        memset(attitude_body_debug, 0, MAVLINK_MSG_ID_ATTITUDE_BODY_DEBUG_LEN);
    memcpy(attitude_body_debug, _MAV_PAYLOAD(msg), len);
#endif
}
